﻿@using Yelper.Web
@model User

@{
    ViewBag.Title = "Profile settings";
}

<h1>Profile settings @@@Model.Username</h1>

@if (null != ViewData["saved"] && (bool)ViewData["saved"]) { 
<div class="success">Changes saved!</div>
}

@using (Html.BeginForm("Profile", "Account", FormMethod.Post, new { enctype = "multipart/form-data" })) {
    
    <div class="FormImgItem">
        <div class="FormImg">
            <img src="@Url.ProfilePicture(Model)?v=@DateTime.UtcNow.Ticks.ToString()" alt="avater" class="image80" />
        </div>
        <div class="FormImgInfo">
            Profile picture
        </div>   
        <div class="FormImgSelect">
            <input id="profilepic" name="profilepic" type="file" />
        </div>  
        @Html.ValidationMessage("upload")
    </div>
    
    <div class="FormItem">
        <div class="FieldInfoTiny">
            @Html.LabelFor(x => x.Website)
        </div>
        <div class="Field">
            @Html.TextBoxFor(x => x.Website)
            @Html.ValidationMessageFor(x => x.Website)
        </div>    
    </div>
    
    <div class="FormItem">
        <div class="FieldInfoTiny">
            @Html.LabelFor(x => x.Bio)
        </div>
        <div class="Field">
            @Html.TextAreaFor(x => x.Bio, new { @class = "BioText" })
            @Html.ValidationMessageFor(x => x.Bio)
        </div>    
    </div>

    <div class="FormButton">
        <input type="submit" value="Save changes" />
    </div>

}

@section right {
    <h1>Actions</h1>
    @Html.ActionLink("Change password", "ChangePwd")
}